A VM (Virtual Machine) technique is a technique for logically or physically partitioning (or dividing) hardware possessed by a computer such as an information processing device or the like, and for making an OS (Operating System) run on partitioned (or divided) hardware. With the virtual machine technique, an OS is made to run on each piece of hardware virtualized by partitioning hardware, whereby a plurality of OSs can be made to run as the entire computer. Each of the OSs (guest OSs) running on the partitioned hardware logically implements one computer. This means that computers such as a plurality of servers or the like can be integrated into one computer. Accordingly, the virtual machine technique offers an advantage of reducing the number of computers (physical machines) to be introduced, and an advantage of simplifying a network configuration.
On virtual machines that are computers logically implemented with the virtual machine technique, programs as workloads are respectively executed. Normally, different workloads are respectively executed on virtual machines. The workloads can be sorted according to their properties. As typical examples of types of the workloads, a CPU (Central Processing Unit)-bound job, and an IO (Input Output)-bound job can be cited.
The CPU-bound job is a workload that mainly executes a calculation process by a CPU. The CPU-bound job has a property such that a response time that is a processing time of a workload from when a CPU issues an IO request to an IO device until when the IO device makes an IO response to the CPU decreases with an increase in the number of CPUs assigned to workloads.
The IO-bound job is a workload that relatively makes an IO to/from a recording medium for storing data (a storage device to which an access is relatively made slowly), or an IO to/from a network. This is typified by a database system. The IO-bound job has a property such that a processing time of a workload reduces with a decrease in a time period needed to complete an IO.
In a computer where a virtual machine system environment is implemented, workloads having different properties are respectively executed on virtual machines in normal cases.
In a virtual machine system, a virtual machine monitor (hypervisor) as a virtual machine monitoring unit assigns a CPU as a computation resource to each virtual machine. Typically, both a method implemented by setting a dispatch timer and a method implemented by detecting an idle state are used together as a method for returning a control of a CPU from a virtual machine to which the CPU is assigned to the hypervisor.
With the method implemented by setting a dispatch timer, a timer is set when a CPU is assigned to a virtual machine, and a control of the CPU is returned to the hypervisor by measuring a predetermined time period (dispatch time that is a time period for assigning a CPU) with the timer. If the control of the CPU is returned to the hypervisor with this method, it can be determined that a workload executed in the virtual machine is a CPU-bound job.
With the method implemented by detecting an idle state, a control of a CPU is returned from a virtual machine to the hypervisor at timing when the virtual machine enters a state of waiting for completion of an IO, namely, enters an idle state. If the control of the CPU is returned to the hypervisor with this method, it can be determined that a workload executed by the virtual machine is an IO-bound job.
If the above described two methods are used together, the execution efficiency of an IO-bound job executed in a virtual machine is heavily influenced by other virtual machines. In a virtual machine where a CPU-bound job is executed, a relatively long dispatch time needs to be set. For this reason, the number of times that a CPU is assigned per unit time decreases with an increase in the number of other virtual machines where a CPU-bound job is executed, leading to degradation in the execution efficiency. Accordingly, in a virtual machine where an IO-bound job is executed, it is important to prevent the execution efficiency from being degraded. Here, the executing efficiency is a ratio at which a workload executes a significant process per unit time.
As a method for preventing the execution efficiency in a virtual machine where an IO-bound job is running from being degraded, a method implemented by setting a short dispatch time, and a method implemented by preferentially assigning a CPU to a virtual machine in an IO completion interrupt wait state are considered. However, these methods have the following problems.
With the method implemented by setting a short dispatch time, a CPU control right that is a right to control a CPU is passed faster to a virtual machine where an IO-bound job is executed by shortening a time interval of passing the CPU control right to a virtual machine. With this method, however, the amount of a process executed by a hypervisor grows with an increase in the number of times of switching the CPU control right per unit time, so that an overhead that consumes machine resources in portions other than an original objective portion increases. An increase in the overhead not only degrades the performance of the entire virtual machine system but reduces the number of times that a CPU is assigned to a virtual machine per unit time. Consequently, the execution efficiency of each virtual machine is unwillingly decreased. Therefore, this method is undesirable.
With the method implemented by preferentially assigning a CPU to a virtual machine in an IO completion interrupt wait state, a virtual machine waiting for IO completion is detected, and IO completion is preferentially notified to the virtual machine. With this method, however, if the number of virtual machines executing an IO-bound job increases, it becomes difficult to pass the CPU control right to a virtual machine executing a CPU-bound job. Moreover, it becomes necessary to detect a virtual machine waiting for an IO completion interrupt. Therefore, the amount of a process executed by a hypervisor increases, leading to an increase in an overhead. Accordingly, also this method is undesirable.    Patent Document 1: Japanese Laid-open Patent Publication No. 2002-215408    Patent Document 2: Japanese Laid-open Patent Publication No. 2006-059052    Patent Document 3: Japanese Laid-open Patent Publication No. 07-110774